package dyyx.comp;

import java.util.Comparator;

import org.apache.kafka.common.TopicPartition;

public class TopicPartitionComparator implements Comparator<TopicPartition>{
	
	public  int compare(TopicPartition o1, TopicPartition o2){
		int tmp = o1.topic().compareTo(o2.topic());
		if(tmp!=0){
			return tmp;
		}
		
		return new Integer(o1.partition()).compareTo(o2.partition());
	}


}